#version 150

#moj_import <config.glsl>

uniform sampler2D Sampler0;

uniform vec4 ColorModulator;

in float depth;
in vec4 vertexColor;
in vec2 texCoord0;

out vec4 fragColor;

void main() {
    if(HIDE_ACTIONBAR && check_depth(depth,DEPTH_ACTIONBAR))discard;
    if(HIDE_BOSSBAR && check_depth(depth,DEPTH_BOSSBAR))discard;
    if(HIDE_CHAT && check_depth(depth,DEPTH_CHAT))discard;
    if(HIDE_CHAT_INPUT && check_depth(depth,DEPTH_CHAT_INPUT))discard;
    if(HIDE_HOTBAR_ITEM_COUNT && check_depth(depth,DEPTH_HOTBAR_ITEM_COUNT))discard;
    if(HIDE_INVENTORY_ITEM_COUNT && check_depth(depth,DEPTH_INVENTORY_ITEM_COUNT))discard;
    if(HIDE_MOVING_ITEM_COUNT && check_depth(depth,DEPTH_MOVING_ITEM_COUNT))discard;
    if(HIDE_NAMELIST && check_depth(depth,DEPTH_NAMELIST))discard;
    if(HIDE_SYNTAX_HINT && check_depth(depth,DEPTH_SYNTAX_HINT))discard;
    if(HIDE_TITLE && check_depth(depth,DEPTH_TITLE))discard;
    if(HIDE_TOOLTIPS && check_depth(depth,DEPTH_TOOLTIPS))discard;

    vec4 color = texture(Sampler0, texCoord0).rrrr * vertexColor;
    if (color.a < 0.1) {
        discard;
    }
    fragColor = color * ColorModulator;
}
